import request from "@/utils/request";
import type { SearchEmpModel, ResultModel, StuModel } from "@/api/model/model";

export const querySubject = (
  name: string,
  principalId: string,
  currentPage: number,
  pageSize: number
) =>
  request.get<any, ResultModel>(
    `/subjects?name=${name}&principalId=${principalId}&page=${currentPage}&pageSize=${pageSize}`
  );

export const getSubjectById = (id) => {
  return request.get(`/subjects/${id}`);
};

export const updateSubject = (subject) => {
  return request.put(`/subjects`, subject);
};

export const addSubject = (subject) => {
  return request.post(`/subjects`, subject);
};

export const deleteSubjectByIds = (ids) => {
  return request.delete(`/subjects/${ids}`);
};
